<?php
	//OFfre
	class Offer extends Model{
		
		//Constructeur
		public function __construct($idOffer, $idAdvert, $idRoom, $promo, $grade, $ageMin, $ageMax){
			parent::__construct('offer');
			$this->idOffer=$idOffer;
			$this->idAdvert=$idAdvert;
			$this->idRoom=$idRoom;
			$this->promo=$promo;
			$this->grade=$grade;
			$this->ageMin=$ageMin;
			$this->ageMax=$ageMax;
		}
		
		//Suppression d'une offre
		public function delete(){
			parent::delete();
			$room = RoomDB::getRoomById($this->idRoom);
			if(!is_null){
				$room->delete();
			}
		}
		
	
	}
?>